package demo.mq.rocket.vo;

import com.alibaba.fastjson.JSON;
import demo.java.time.DateTimeDemo;

import java.time.LocalDateTime;

public class TopicQueueStats {

    private String queue;

    private Integer minOffset;

    private Integer maxOffset;

    private Long lastUpdateTimestamp;

    public String getQueue() {
        return queue;
    }

    public void setQueue(String queue) {
        this.queue = queue;
    }

    public Integer getMinOffset() {
        return minOffset;
    }

    public void setMinOffset(Integer minOffset) {
        this.minOffset = minOffset;
    }

    public Integer getMaxOffset() {
        return maxOffset;
    }

    public void setMaxOffset(Integer maxOffset) {
        this.maxOffset = maxOffset;
    }

    public Long getLastUpdateTimestamp() {
        return lastUpdateTimestamp;
    }

    public void setLastUpdateTimestamp(Long lastUpdateTimestamp) {
        this.lastUpdateTimestamp = lastUpdateTimestamp;
    }

    public LocalDateTime getLastUpdateTime() {
        if (this.lastUpdateTimestamp == null) {
            return null;
        }
        return DateTimeDemo.toLocalDateTime(this.lastUpdateTimestamp);
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }

}
